package com.h5;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cyz.service.UserCouponService;
import com.shopcart.service.StoreCommentService;
import com.vsd.service.UserCollectService;

@RequestMapping("/m/home")
@Controller
public class H5HomeController extends H5BaseController{
	
	@Autowired
	StoreCommentService commentService;
	@Autowired
	UserCouponService userCouponService;
	@Autowired
	UserCollectService userCollectService;

	@RequestMapping("/myComment")
	@ResponseBody
	public String myCommentList(HttpSession session,Integer page, Integer limit){
		String userId = getSessionParameter(session, "id");
		return commentService.myCommentList(userId, page, limit);
	}
	
	@RequestMapping("/myCoupons")
	@ResponseBody
	public String myCoupon(HttpSession session){
		String userId = getSessionParameter(session, "id");
		return userCouponService.getMyCouponList(userId);
	}
	
	@RequestMapping("/myCollectGoods")
	@ResponseBody
	public String collectGoods(HttpSession session,String lat, String lng,
			Integer page, Integer limit){
		String userId = getSessionParameter(session, "id");
		return userCollectService.collectGoods(userId, lat, lng, page, limit);
	}
	@RequestMapping("/myCollectStore")
	@ResponseBody
	public String collectStore(HttpSession session,String lat, String lng,
			Integer page, Integer limit){
		String userId = getSessionParameter(session, "id");
		return userCollectService.collectStore(userId, lat, lng, page, limit);
	}
}
